Technical Field
The disclosure is related to a media streaming method and a device using the same.
Related Art
In recent years, people are used to watch live media stream, such as live broadcast of a major competition or show, road or building monitoring, live playback of captured game images, distant education, online live news, live broadcast of a disaster and so on. Due to the variety characteristics of a network, a media receiver uses a data buffer to store media data having time lengths from hundreds of milliseconds to seconds so as to mitigate playback discontinuity due to the network delay and jitter. However, such a simple solution can not make the live media stream to get adapted to changes in the network. When network congestion occurs for a long period that the data in the buffer is exhausted, a typical player in the media receiver reacts in two ways as follows. One of the reactions is not to give up any data which is not yet played back, but temporarily pause until a certain data amount appears in the buffer again. However, a result of a lager lag between the watching progress and the current progress occurs. Another reaction is to discard any data which is received at a time exceeds the playback time; however, this will result in following frames being incorrectly presented.
In order to solve the above problems, many solutions have been proposed in last ten years. One of the solutions called bitstream switch gradually tends to become a trend, by which a video is encoded into several streams at different bit rates. Note that those streams are independent of each other. The media receiver selects a highest bit rate to watch from the bit rates, which is under an available bandwidth according to his/her own network environment at an appropriate time point. This solution has an advantage that the media provider merely has to compress a video into a limited number (commonly 3˜5) of streams with different bit-rates which most users are interested in or able to receive and thus, will not result in heavy burden to the media provider. Additionally, in most cases, the watching quality that the media receiver can get is also almost close to the optimal quality that can be achieved in the network environment.
Currently on the market, at least two freeware is available for providing the function of producing streams of different bit rates. One of them is a software named “Flash Media Live Encoder” (referred to as FMLE) of Adobe®. Through this software, data transmitted from a webcam may be compressed as media streams of three bit rates and sent via a real-time messaging protocol (RTMP). The image compression format is VP6 or H.264, and the audio compression format is mp3 or NellyMoser. Another software is the open-source “FFMpeg”. The software may transfer an original media streaming into a numerous number (depending on hardware capability) of media streams which support most well-known compression formats, and these media streams can be sent via at least RTP, LiveFLV, or RTMP protocols). Moreover, on may well-known video-sharing platforms, such as Youtube® and Youku®, most videos have several types of playback quality for selection. Currently, the video programs available on theses platforms are not live but pre-recorded. However, people have been very used to such usage mode and certainly, expect live media-sharing platforms to provide media streams of different playback quality in the future.
However, the users should not switch between streams at an arbitrary time due to the following reasons. First, network conditions may change dramatically over a short period of time. If the bitstream switch operation reacts too aggressively based on the transient network conditions, it may cause undesirable temporary fluctuations in the use of bandwidth. Eventually, the throughput of the streaming flows deteriorates sharply and it can incur noticeable damage to the streaming quality. Thus, to confirm the network becomes stable, the users should adopt existing bandwidth estimation algorithms which can avoid the effect of the transient changes. Besides, the commonly used image compression algorithms (the H.264, the Mpeg 2 and 4 standards) define three types of frames, i.e. I, P and B frames, for example, to present data, and the P-frames or the B-frame have to directly or indirectly refer to the latest I-frames. Thus, the time point of the bitstream switch operation is limited by the time point where the I-frames appear, which leads to two functional demands. One is to provide an acceptable watching quality before the switch, and the other one is to assist the user under stable network condition to switch as soon as possible.
In summary, several trends of users' habits can be observed according to the current technique, which are as follows. (1) More and more users turn to use a tablet PC or a smart phone to watch media streaming; however, such apparatuses have limited computation capability and power. (2) Usually, a popular program may be watched by hundreds or thousands of users. (3) The peer-to-peer (P2P) architecture becomes more and more popular, and in a P2P system, each user would like to share media streaming with others. These trends of usage habits result in two demands in performance. Namely, the computation demand should not overwhelm the mobile devices and the network bandwidth demand should keep as small as possible.